package com.example.loop.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class SpringRabbitListener {


    @RabbitListener(queues = "simple.queue")
    public void listenSimpleQueue(String msg) {
        System.out.println("消费者接收到simple.queue的消息：" + msg);

        log.debug("消费者接收到simple.queue的消息：{}", msg);
        System.out.println(1 / 0);
        log.info("消费者处理消息成功");
    }
}
